

var should = require('should');
var categoryServices = require('../services/Category');

describe('Category', function () {

    it('result should be exists when type = article', function (done) {

        var type = 'article'
        categoryServices.list(type, function (result) {

            should.exist(result);
            result.length.should.within(0, 20);
            done();
        });

    })

    it('result should be [] when type = other', function (done) {

        var type = 'other';
        categoryServices.list(type, function (result) {
            should.deepEqual(result, []);
            done();
        });
    })

    it('result should be exists when type = product', function (done) {

        var type = 'product';
        categoryServices.list(type, function (result) {
            should.exist(result);
            result.length.should.within(0,20);
            done();
        });

    })
})